﻿@model XHouse.Model.Zona

@{
    ViewBag.Title = "Nueva Zona";
}

<div class="row">
    <div class="col-xs-12 col-md-10 col-md-offset-1">
        <div class="page-header">
            <h3>Nueva Zona</h3>
        </div>
        @using (Html.BeginForm(null, null, FormMethod.Post, new { @class = "form-horizontal", @role = "form" }))
        {
            if (ViewData.ModelState != null && !ViewData.ModelState.IsValid)
            { 
               
            <div class="alert alert-danger alert-dismissable">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                @Html.Raw(HttpUtility.HtmlDecode((Html.ValidationSummary(false,"Errores:") ?? (object)"").ToString()))
            </div>
            }
    
                        
            <div class="form-group @(Html.ViewData.ModelState.IsValidField(Html.IdFor(model => model.Nombre).ToString()) ? null : "has-error")">

                <label for="Nombre" class="col-lg-2 control-label">Nombre</label>
                <div class="col-lg-3">
                    @Html.TextBoxFor(model => model.Nombre, new { @class = "form-control" })
                </div>
            </div>
            
            <div class="form-group @(Html.ViewData.ModelState.IsValidField(Html.IdFor(model => model.Descripcion).ToString()) ? null : "has-error")">

                <label for="Descripcion" class="col-lg-2 control-label">Descripción</label>
                <div class="col-lg-3">
                    @Html.TextBoxFor(model => model.Descripcion, new { @class = "form-control" })
                </div>

            </div>
            <div class="form-group">
                <div class="col-lg-offset-2 col-lg-3">
                    <button class="btn btn-primary">Guardar</button>
                    <a class="btn btn-danger" href="@Url.Action("Index")">Cancelar</a>
                </div>
            </div>
                   
        }

    </div>
</div>

